#include "config_parser.hpp"

std::unique_ptr<LogConfigParser> LogConfigParser::instance_ = nullptr;
std::once_flag LogConfigParser::init_flag_;


class ParamLoaderNode : public rclcpp::Node {
public:
  ParamLoaderNode() : Node("param_loader") {
    auto& config_parser = LogConfigParser::getInstance("rcl_logging_spdlog");
    auto config = config_parser.get_node_config(this->get_name());
    RCLCPP_INFO(this->get_logger(), "Max File Size: %zu", config.max_file_size);
  }
};

int main(int argc, char** argv) {
  rclcpp::init(argc, argv);
  auto node = std::make_shared<ParamLoaderNode>();
  rclcpp::spin(node);
  rclcpp::shutdown();
  return 0;
}